Skip to content

Fix bugs in the course pages that the frontend upgrade's reviews found - #35

Merged
pancakereport merged 2 commits into
mainfrom
frontend-fixes
Nov 24, 2026
Merged

pancakereport merged 2 commits into
mainfrom
frontend-fixes

Conversation

@pancakereport

@pancakereport pancakereport commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Bugs on main that the reviews of #27 found in code that PR touched, and left for a separate PR.

Closes #24

Fixes

  • A group page for a group that doesn't exist made the server answer 500 (load_group used .one()), and the page asked again on every render, so it sent requests nonstop with the offline banner showing. The server now answers null (as load_ticket does), and the page asks once, from an effect (again if the request fails, once it's back online), then shows Not found. An ID that isn't a number, such as /groups/abc, also shows Not found.
  • Moving from one ticket or group page to another kept the previous page's state (Ticket page keeps the previous ticket's assignment and question after Next Ticket #24): the assignment and question boxes, a half-typed description, and a ticket the page never loaded. Each ticket and group now gets a new page (ByID in app.jsx keys it by the URL's ID).
    • bootstrap-select selects its "Assignment" placeholder when it sets up a select whose option React chose, so on the new page the menu showed the placeholder. SelectPicker now chooses the value again after setting it up.
  • A settings Save button stayed disabled after a failed save, since a failed request never calls its callback. Socket.emit and makeRequest now return a promise of whether the request succeeded, settled either way, and ConfigLinked waits on that. Callbacks still only run on success, since several use the response directly.
  • A ticket or group with no question showed "QNaN". Only a question of digits gets the "Q" prefix.
  • Party groups were sorted with a one-argument comparator ((x) => x.id), which leaves the order up to the browser. They're sorted by ID.
  • MagicWordDisplay set state while rendering. It's a function component that fetches a timed magic word from an effect, right away rather than after the first ten seconds, and stops when the mode changes.

Testing

  • New end to end tests, each of which fails on main and passes here: a missing group's page asks once and shows Not found, asks again after a failed request, and /groups/abc shows Not found; a group with no question doesn't show "QNaN"; a failed save leaves the Save button usable; Next Ticket shows the next ticket's assignment and question, in bootstrap-select's menu too; staff see a timed magic word within five seconds. They use a new watch_requests helper in tests/e2e/conftest.py, which counts the page's API requests and can make some fail.
  • A server test that load_group answers null for a missing group.
  • The group sort isn't tested: Chrome keeps the server's order with the old comparator, so a browser test can't see the difference.
  • pytest (123), pytest tests/e2e (33), flake8, yarn lint, yarn typecheck, yarn build. The screenshots of every page are unchanged from before Build the frontend with Vite, and upgrade React and React Router #27 apart from relative times, except a missing group's page, which shows Not found.

🤖 Generated with Claude Code

- A group page for a group that doesn't exist: load_group raised (a 500),
  and the page asked again on every render, nonstop. The server answers
  nothing, the page asks once, from an effect, and shows Not found.
- Next Ticket, or any move from one ticket or group page to another, kept
  the previous page's state: its assignment and question (#24), a half-typed
  description, and a ticket that was never loaded. Each ticket and group now
  gets a new page. bootstrap-select chose its placeholder when it set up the
  new page's assignment menu, so SelectPicker chooses the value again.
- A settings Save button stayed disabled after a failed save, since a failed
  request never calls its callback. makeRequest returns a promise that settles
  either way, and the form waits on that.
- A ticket or group with no question showed "QNaN".
- Party groups were sorted with a one-argument comparator, which leaves the
  order undefined; they're sorted by ID.
- MagicWordDisplay set state while rendering. It fetches a timed magic word
  from an effect, right away rather than after the first ten seconds.

Closes #24

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.63%. Comparing base (067b7ee) to head (b4d4712).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   77.55%   77.63%   +0.07%     
==========================================
  Files          11       11              
  Lines        1368     1368              
  Branches      195      195              
==========================================
+ Hits         1061     1062       +1     
+ Misses        251      248       -3     
- Partials       56       58       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

🚀 Staging Preview Deployed!

URL: https://preview-oh-pr-35-137456085712.us-west1.run.app

- A group page whose request failed (the network down for a moment) stayed
  on "loading..." for good: it asks again whenever the connection comes back.
- An ID that isn't a group's, such as /groups/abc, got an error back that was
  stored as a group, so the page never said it isn't found. Only a group with
  that ID counts as one.
- Only a question of digits is shown as a number ("Q3"), so "1e3" or
  "Infinity" are shown as they are.
- A timed magic word is forgotten when the mode changes, so an old one isn't
  shown if timed mode comes back.
- The empty question test waits for the group's card, and watch_requests can
  fail only the first few requests to an endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pancakereport
pancakereport merged commit 2866ae7 into main Nov 24, 2026
13 checks passed
@pancakereport
pancakereport deleted the frontend-fixes branch November 24, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ticket page keeps the previous ticket's assignment and question after Next Ticket

2 participants